#include <stdio.h>
#include <assert.h>
char* my_strncpy(char* a, const char* b,int num)
{
	assert(a && b);
	char* ret = a;
	int i;
	for (i = 0; i < num && b[i] != '\0'; i++)
	{
		a[i] = b[i];
	}
	return ret;
}

int main()
{
	char a[] = "abcdef";
	char b[20] = { 0 };
	my_strncpy(b, a, 19);
	printf("%s\n", b);
	return 0;
}